/*
 * @Author: ljb
 * @Description: 
 * @Date: 2021-11-09 10:14:08
 * @LastEditTime: 2021-11-09 10:14:10
 * @FilePath: \mvvm\lib\Watcher.js
 */
class Watcher {
    constructor(name, domNode, vm, exp, domProp) {
        this.name = name
        this.domNode = domNode
        this.vm = vm
        this.exp = exp
        this.domProp = domProp

        this.update()
    }

    update() {
        this.domNode[this.domProp] = this.vm.$data[this.exp]
    }
}

export default Watcher